package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailMapper {
    /**
     * 向订单明细中批量插入数据
     * @param orderDetails
     */
    void insertBatch(List<OrderDetail> orderDetails);

    /**
     * 根据订单id OrderId 查询订单详情
     * @param OrderId
     * @return
     */
    @Select("select * from Order_detail where order_id =#{orderId}")
    List<OrderDetail> getOrderDetailById(Long OrderId);

    /**
     * 根据订单id OrderId 删除订单详情
     * @param OrderId
     *//*
    @Delete("delete from Order_detail where order_id =#{OrderId}")
    void cancelOrderDetailByOrderId(Long OrderId);*/
}
